<jsp:useBean id="sessiondata" class="bibbletex.models.SessionData"
	scope="session" />

<%@ page
	import="bibbletex.models.Collaboration,bibbletex.models.Reference,bibbletex.models.SessionData"
	import="java.util.List,bibbletex.views.CollaborationView, bibbletex.controllers.CollaborationController"
	import="java.util.UUID" %>

<%
	String page_title = new String("Reference attributes");
	String onloadjsfunction=new String("");
	boolean show_title = true;
	String[] jstitle={"collab"};
	boolean show_navigation = true;
%>
<%@ include file="/header.jsp"%>

<%
	String id_parameter = request.getParameter("rid");
	Reference r;
	if (id_parameter != null){
		r = sessiondata.collaboration.getAllReferences().get(
				sessiondata.collaboration.getAllReferences().indexOf(
						new Reference(UUID.fromString(id_parameter))));
		sessiondata.reference = r;
	}
	else
		r = sessiondata.reference;
%>
<div class="buttonWrapper">
	<a class="button" href="/collaboration/show.jsp">
		Back to Collaboration
	</a>
</div>
<h2>Reference</h2>

<p>
	Type:
	<%=r.getType()%>
</p>

<p>
	Title:
	<%=r.getTitle()%>
</p>

<p>
	Description:
	<%=r.getAuthors()%>
</p>

<% if (sessiondata.collaboration_is_editable) { %>
<div class="buttonWrapper">
	<a class="button" href="edit.jsp?rid=<%= r.getId() %>">
		Edit this reference
	</a>
</div>
 <% } %>

<%@ include file="/footer.jsp"%>
